import request from '@/utils/request'
/**
 * 获取用户频道，可以不登录
 * @returns Promise
 */
export function getChannelList () {
  return request({
    method: 'get',
    url: '/v1_0/user/channels'
  })
}
/**
 *获取所有频道列表
 * @returns
 */
export const getAllChannelList = () => {
  return request({
    method: 'get',
    url: '/v1_0/channels'
  })
}
/**
 *添加 频道
 * @param {*} channels
 * @returns
 */
export const addChannel = (channels) => {
  return request({
    method: 'patch',
    url: '/v1_0/user/channels',
    data: {
      channels
    }
  })
}
/**
 *删除频道
 * @param {*} id 频道id
 * @returns
 */
export function delChannel (id) {
  return request({
    method: 'DELETE',
    url: `/v1_0/user/channels/${id}`
  })
}
